From 28e4db994903e8c10cb9bce3c133b4f3856c981a Mon Sep 17 00:00:00 2001 From: Brian Woods Date: Fri, 23 Feb 2018 11:04:48 +0100 Subject: [PATCH] x86/svm: enable pause filtering threshold If available, enable the pause filtering threshold feature. See the previous commit for more information. Signed-off-by: Brian Woods Reviewed-by: Babu Moger Reviewed-by: Boris Ostrovsky --- xen/arch/x86/hvm/svm/svm.c | 1 + xen/arch/x86/hvm/svm/vmcb.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index 64d2955b22..1bc95da12c 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -1700,6 +1700,7 @@ const struct hvm_function_table * __init start_svm(void) P(cpu_has_svm_vloadsave, "Virtual VMLOAD/VMSAVE"); P(cpu_has_svm_vgif, "Virtual GIF"); P(cpu_has_pause_filter, "Pause-Intercept Filter"); + P(cpu_has_pause_thresh, "Pause-Intercept Filter Threshold"); P(cpu_has_tsc_ratio, "TSC Rate MSR"); #undef P diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c index 997e7597e0..ae60d8dc1c 100644 --- a/xen/arch/x86/hvm/svm/vmcb.c +++ b/xen/arch/x86/hvm/svm/vmcb.c @@ -210,6 +210,9 @@ static int construct_vmcb(struct vcpu *v) { vmcb->_pause_filter_count = SVM_PAUSEFILTER_INIT; vmcb->_general1_intercepts |= GENERAL1_INTERCEPT_PAUSE; + + if ( cpu_has_pause_thresh ) + vmcb->_pause_filter_thresh = SVM_PAUSETHRESH_INIT; } vmcb->cleanbits.bytes = 0; -- 2.30.2